package com.shitou.shitouorder.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.shitou.shitoucommons.utils.PageUtils;
import com.shitou.shitoucommons.utils.RespBean;
import com.shitou.shitoucommons.vo.RefundVo;
import com.shitou.shitouorder.entity.OrderEntity;
import com.shitou.shitouorder.vo.DeleteOrderVo;
import com.shitou.shitouorder.vo.GetMemberOrderVo;
import com.shitou.shitouorder.vo.OrderVo;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * 订单
 *
 * @author shitouren
 * @email 3076767823@qq.com
 * @date 2023-03-21 16:29:51
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 创建订单接口
     * @param orderVo
     * @return
     * @see OrderVo 可以查看对应的
     */
    RespBean createOrder(OrderVo orderVo, HttpServletRequest request, HttpServletResponse response);
    RespBean test(OrderVo orderVo, HttpServletRequest request, HttpServletResponse response);

    /**
     * 通过状态获取用户的订单
     * @param memberOrderVo
     * @return
     */
    RespBean getMemberOrder(GetMemberOrderVo memberOrderVo, HttpServletRequest request, HttpServletResponse response);

    /**
     * 获得该用户的分页数据,通过状态和参数
     * @param memberOrderVo
     * @param params
     * @return
     */
    @Deprecated
    RespBean getMemberOrderPage(GetMemberOrderVo memberOrderVo, Map<String, Object> params);

    /**
     * 删除用户的订单信息
     * @param deleteOrderVo
     * @return
     */
    RespBean deleteOrder(DeleteOrderVo deleteOrderVo);


    /**
     * 用户自动确认收货
     * @param orderSn 订单号
     * @return
     */
    RespBean confirm(String orderSn);


    /**
     * 获得订单的详细信息
     * @param orderSn
     * @param spuId
     * @param memberId
     * @return
     */
    RespBean getOrderInfo(String orderSn, long spuId, long memberId);


    /**
     * 申请退款请求
     * @param memberId
     * @param orderItemId
     * @return
     */
    RespBean refund(Long memberId, String orderSn, Long orderItemId);


    /**
     * 对退款请求的操作，同意退款或者不不同意退款
     * @param refundVo
     * @return
     */
    RespBean refundOption(RefundVo refundVo);


    /**
     * 通过会员id获取相应的订单信息
     * @param params
     * @param memberId
     * @return
     */
    RespBean queryPageByMemberId(Map<String, Object> params, Long memberId);
//    RespBean invalidOrder()
}

